package day5;

public class t8 {
    public static void main(String[] args) {
        int []arr={1,2,3,4,5,6,7,8,9};
        int []arr1=printfarr(arr,1,7);
        for (int j : arr1) {
            System.out.print(j + " ");
        }
    }
    public static int [] printfarr(int []arr,int form,int to){
        int []arr1= new int[to-form];
        int k=0;
        for(int i=form;i<to;i++){
            arr1[k] = arr[i];
            k++;
        }
        return arr1;
    }

}
